package com.future.taglib
import com.future.Task
import com.future.TaskUpdate

class GetVersionTagLib {
  def getVersion={attrs->
    def taskInstance=attrs.taskInstance
    try{
    if(taskInstance!=null){
//      println taskInstance+"-"+TaskUpdate.listOrderByTask(taskInstance,order:"desc").get(0).thisVersion
      out<<TaskUpdate.executeQuery("select  thisVersion from TaskUpdate order by dateCreated desc").get(0)
    }else{
      out <<'0.1+'
    }
    }catch(Exception e){
//      println e.getMessage()
      out<<'0.1-'
    }
  }
}
